/**
 * Copyright (C), 2019-2020, 宇信融汇
 * FileName: HashSetTest
 * Author:   xbliu
 * Date:     2020/7/20 16:09
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * xbliu           修改时间           版本号              描述
 */
package c_008.collection;

import org.junit.Test;

import java.util.HashSet;

/**
 * @Classname HashSetTest
 * @Description TODO
 * @Date 2020/7/20 16:09
 * @Created by xbliu
 */
public class HashSetTest {

    @Test
    public void HashSetTest() {
        HashSet set = new HashSet();
        Person aa = new Person("aa", 20);
        Person bb = new Person("bb", 30);
        set.add(aa);
        set.add(bb);
        System.out.println(set);//2


        aa.setName("cc");
        set.remove(aa);
        System.out.println(set);//2
        set.add(new Person("cc", 20));
        System.out.println(set);//3
        set.add(new Person("aa", 20));
       // set.remove(aa);
        System.out.println(set);
    }
}
